import React, { Component } from 'react'
import EventHub from './eventHub'


export default class One extends Component {
    constructor(){
        super()
        this.state = {
            color:'red'
        }
    }
    componentDidMount(){
        EventHub.on("chufaOne",color=>{
            this.setState({color})
        })
    }
    render() {
        return (
            <div style = {{color:this.state.color}}>
                one--one--one--one--one--one--one--one
            </div>
        )
    }
}
